package cl.cliente;

import ws.LibroWS;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class LoginAdmin extends Activity{
	TextView textAut;
	EditText pass;
	Button ver;
	LibroWS ws = new LibroWS();
	int idLibro;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		this.setContentView(R.layout.login);
		
		textAut = (TextView)findViewById(R.id.textRes);
		pass = (EditText)findViewById(R.id.editPass);
		ver = (Button)findViewById(R.id.verRes);
	}
	public void ejecutar(View v){
		idLibro = ws.autentificarLibro(pass.getText().toString());
		Log.i("log-android","login administrador--"+idLibro);
		if(idLibro!=0){
		Intent i = new Intent(getApplicationContext(), VerResultados.class);
		i.putExtra("codLibro", this.idLibro);
		startActivity(i);
		}
//		else{
//			
//			Toast.makeText(getBaseContext(), res, 
//					Toast.LENGTH_SHORT).show();
//		}
	}

}
